/*
 * Copyright (C) 2012 Martin Řehánek
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package cz.mzk.funnylib.api;

import com.mysql.jdbc.jdbc2.optional.MysqlDataSource;
import org.springframework.jdbc.core.JdbcTemplate;

/**
 *
 * @author Martin Řehánek
 */
public class Configuration {

    public static JdbcTemplate getTemplate() {
        /*
        DriverManagerDataSource dataSource = new DriverManagerDataSource();
        dataSource.setUrl("jdbc:mysql://localhost:3306/funnylib");
        dataSource.setUsername("funnylib");
        dataSource.setPassword("funnylib");
        */
        MysqlDataSource dataSource = new com.mysql.jdbc.jdbc2.optional.MysqlDataSource();
        dataSource.setUser("funnylib");
        dataSource.setPassword("funnylib");
        dataSource.setServerName("localhost");
        dataSource.setDatabaseName("funnylib");
        dataSource.setEncoding("UTF-8");
        return new JdbcTemplate(dataSource);
    }
}
